1. Field of the Invention
This invention relates to computer systems and more particularly to power management of such systems.
2. Description of the Related Art
Power consumption and associated performance and thermal issues are considerations for every computer system design. For example, a conventional notebook computer (also commonly referred to as laptop or portable computer) has power and thermal constraints that cause it to operate at performance states below an equivalent desktop computer.
Many power saving techniques have been introduced to try and mitigate the impact of thermal and battery power constraints. The frequency of operation (clock frequency) of the processor and its operating voltage determines its power consumption. Since power consumption and therefore heat generation are roughly proportional to the processor""s frequency of operation, scaling down the processor""s frequency has been a common method of staying within appropriate power limitations. Microprocessors utilized in mobile applications, i.e., those used in battery powered systems, are particularly sensitive to power considerations and therefore generally require the lowest supply voltage that can achieve the rated clock speed. That is in part due to the small, densely packed system construction that limits the ability of the mobile computer system to safely dissipate the heat generated by computer operation.
A common power management technique called xe2x80x9cthrottlingxe2x80x9d prevents the processor from over heating by temporarily placing the processor in a stop grant state. During the stop grant state the processor does not execute operating system or application code and typically has its clocks gated off internally to reduce power consumption. Throttling is an industry standard method of reducing the effective frequency of processor operation and correspondingly reducing processor power consumption by using a clock control signal (e.g. the processor""s STPCLK# input) to modulate the duty cycle of processor operation. A temperature sensor monitors the processor temperature to determine when throttling is needed. Throttling continuously stops and starts processor operation and reduces the effective speed of the processor resulting in reduced power dissipation and thus lowering processor temperature.
Referring to FIG. 1, one prior art system capable of implementing throttling is illustrated. Processor (CPU) 101 receives voltage 102 from voltage regulator 103. The voltage regulator is controlled by voltage identification (VID) signals 104 which are set by system jumper settings 105. A clock multiplier value 107, supplied from system jumper settings 105 (bus frequency (BF)[2:0]) is supplied to CPU 101. CPU 101 multiplies a received bus clock 109 by the multiplier value 107 to generate the core clocks for the processor.
CPU 101 receives a STPCLK# (the # sign indicates the signal is active low) input, which is used to temporarily suspend core clock operation and conserve power. An asserted STPCLK# signal results in the processor entering a stop grant state. In that state, execution of operating system (OS) and application code is stopped, and the core clocks are typically stopped although some minimum logic including clock multiplier logic may still operate.
Appropriately monitoring and controlling the processor""s operating parameters is important to optimizing the notebook""s performance and battery life. Power management in older personal computer systems was typically implemented using micro-controllers and/or proprietary use of the system management interrupt (SMI). Current x86 based computer systems utilize an industry supported power management approach described in the Advanced Configuration and Power Interface Specification (ACPI). The ACPI is an operating system (OS) controlled power management scheme that uses features built into the Windows 9x and Windows NT or other compatible operating systems. It defines a standard interrupt (System Control Interrupt or SCI) that handles all ACPI events. Devices generate system control interrupts to inform the OS about system events.
As part of that power management approach, ACPI specifies sleep and suspend states. Sleep states temporarily halt processor operation and operation can be restored in a few milliseconds. A processor enters the sleep state when internal activity monitors indicate no processing is taking place. When a keystroke is entered, a mouse moves or data is received via a modem, the processor wakes up.
Suspend states shut down more of the subsystems (e.g. display or hard drive) and can take a few seconds for operation to be restored. Suspend states may copy the present context of the system (sufficient for the computer to resume processing the application(s) presently opened) into memory (suspend to RAM) or to the hard drive (suspend to disk) and power down peripherals.
For example, in a word processing application, a processor will do a brief burst of work after each letter is typed, then its operation is stopped until the next keystroke. Additionally, peripheral devices may be turned off to obtain move power savings. For example, the processor""s hard drive may be suspended after a certain period of inactivity until it is needed again. If the system detects another period of inactivity, e.g., a few minutes, the display may be turned off. Such techniques are useful in conserving battery power and in the case of the processor, reducing the amount of heat needed to be dissipated. It is also common practice to use a cooling fan to increase the amount of heat removed from the system, lower processor temperature and prevent damage to the system.
While the ACPI environment provides a number of mechanisms to deal with thermal and power issues, it fails to provide a sophisticated power management capability that can more effectively reduce power consumption in computer systems. While power consumption issues are particular important for small portable computers, power consumption issues are important for desktop computers as well. For example, while batteries may not be a consideration for desktop computers, thermal considerations are still an important criteria. In particular, for desktop computers, the hotter they run, the more likely fans are turned on to try and cool the processor, which results in fan noise or frequent cycling of the fans that may be objectionable to the computer user. In addition, saving power can have real economic benefits.
Further, traditional throttling techniques have limitations for certain types of applications. More particularly, throttling has a time overhead associated with it that may disallow its use for some real time (e.g., a soft modem) applications. Thus, although throttling can achieve an xe2x80x9ceffective frequencyxe2x80x9d, an effective frequency is not always as useful as an actual frequency. For example, assume legacy power management techniques are throttling a 1 GHz CPU down to an xe2x80x9ceffective speedxe2x80x9d of 300 MHz. The latency (actual stopped time and switching time) involved in throttling can cause a CPU having an xe2x80x9ceffective speedxe2x80x9d of 300 MHz, to be unable to satisfactorily support a real time application, while a processor actually running at 300 MHz could properly support the application. Thus, there is a difference between actual and effective frequencies for certain applications.
In view of the above considerations, it would be desirable to save power, both in desktop systems and portable systems, without affecting the performance states perceived by the user. In order to do that it would be desirable for power management techniques to determine what performance states were required, and adapt power levels to meet the performance requirements. Those and other improvements in power management are desirable to more effectively provide high performance and effective power management.
In order to ensure that power management software and the actual performance state of a computer system having multiple performance states, remain synchronized, the computer system periodically determines if the power state maintained by power management software matches the actual power state of the processor or other component of the computer system. If not, the actual power state and the software power state are resynchronized, for example, by reinitializing the power management software or otherwise causing the software state to match the hardware state.
In one embodiment, the invention provides a method of managing power in a computing system that includes periodically determining a current hardware power state of an integrated circuit and periodically comparing the current hardware state to a software state maintained by power management software representing the assumed power state of the integrated circuit. If a discrepancy is found to exist between the hardware state and the software state the hardware and software state are resynchronized. The resynchronization may be accomplished in several ways. For example, the resynchronizing may include reinitializing the power management software maintaining the software state. Alternatively, the resynchronization may be accomplished by changing the current software state to match the hardware state or changing the hardware state to match the software state.
In another embodiment, a computer system includes a processor. A first instruction sequence that is operable on the processor periodically determines a current hardware power state of the processor. A second instruction sequence that executes on the processor, periodically compares the current hardware power state to a software maintained power state, the software maintained power state indicating a power state assumed by power management software. The second instruction sequence also provides an indication of the results of the comparison. A third instruction sequence operable on the processor resynchronizes the hardware power state and the software maintained power state if a discrepancy exists between the hardware power state and the software maintained power state.
In another embodiment a computer program product is provided to periodically determine an actual performance state of an integrated circuit and to periodically compare the actual performance state to a software maintained performance state and generate an indication of the comparison. If the indication shows a discrepancy exists between the actual performance state and the software maintained performance state, the computer program product resynchronizes the actual performance state and the software maintained performance state.